package com.kunlun.system.task;

import com.kunlun.system.service.ISystemMachineService;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

/**
 * 系统信息定时收集任务
 *
 * CPU、Disk、Memory
 */
public class ScheduleMonitorTask implements Runnable {

    private static Logger log = LogManager.getLogger();

    private ISystemMachineService systemMachineService;

    public ScheduleMonitorTask(ISystemMachineService systemMachineService) {
        this.systemMachineService = systemMachineService;
    }

    @Override
    public void run() {
        try {
            systemMachineService.collectMonitor();
        } catch (Exception e) {
            log.error("ScheduleMonitorTask Error: ", e);
        }
    }
}
